package com.atguigu.educms.controller.web;

import com.atguigu.common.R;
import com.atguigu.educms.entity.CrmBanner;
import com.atguigu.educms.service.CrmBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author panghl
 * @Date 2021/1/31 15:24
 * @Description 前端banner接口
 **/
@RestController
@RequestMapping("/educms/web/")
@Api(tags = {"前端banner接口"})
public class BannerFrontController {
    @Autowired
    private CrmBannerService crmBannerService;

    @ApiOperation(value = "获取轮播图信息")
    @GetMapping("getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> crmBanners = crmBannerService.getAllBanner();
        return R.ok().data("list",crmBanners);
    }
}
